package com.yunpuvip.sachet.modular.core.exception;

import cn.stylefeng.roses.kernel.model.exception.AbstractBaseExceptionEnum;

/**
 * Guns异常枚举
 *
 * @author fengshuonan
 * @Date 2017/12/28 下午10:33
 */
public enum GunsExceptionEnum implements ServiceExceptionEnum,AbstractBaseExceptionEnum {


    /**
     *业务异常
     */
    UPLOAD_ERROR(500,"上传失败"),

    DATA_NOT_EXIST(501, "数据不存在"),
    GOODS_EXIST(500,"有该类商品存在，不可删除"),
    CATEGORY_NOT_SON(500,"商品类型不是子类"),
    GIFT_EXIST(500,"该赠送类型已存在"),
    ASSOCIATION_EXIST(500,"标签被使用，不可删除"),
    VIDEO_TIME_OVERLAPPING(500,"该时间段与其他时间段重叠"),
    USER_EXIST(500,"该手机已被绑定"),


    /**
     * 其他
     */
    INVLIDE_DATE_STRING(400, "输入日期格式不对"),

    /**
     * 其他
     */
    WRITE_ERROR(500, "渲染界面错误"),
    LIST_ERROR(500, "对象集合不能为空"),

    /**
     * 文件上传
     */
    FILE_READING_ERROR(400, "FILE_READING_ERROR!"),
    FILE_NOT_FOUND(400, "FILE_NOT_FOUND!"),

    /**
     * 错误的请求
     */
    REQUEST_NULL(400, "请求有错误"),
    SERVER_ERROR(500, "服务器异常");

    GunsExceptionEnum(int code, String message) {
        this.code = code;
        this.message = message;
    }

    private Integer code;

    private String message;

    @Override
    public Integer getCode() {
        return code;
    }

    public void setCode(Integer code) {
        this.code = code;
    }

    @Override
    public String getMessage() {
        return message;
    }

    public void setMessage(String message) {

        this.message = message;
    }

    @Override
    public String toString() {
        return "GunsExceptionEnum{" +
                "code=" + code +
                ", message='" + message + '\'' +
                '}';
    }
}
